USERNAME = group14
ASSIGNMENT = 01
SERVER = 138.232.64.210
PORT = 22113
FILES = Control.cpp Control.hpp RotorIF.hpp Rotor.hpp ReflectorIF.hpp Reflector.hpp assignment01.txt

CXXFLAGS += -O0 -Wall -g
LDFLAGS +=
BINS = enigma
SRCS = Control.cpp enigma.cpp
HDRS = Control.hpp Reflector.hpp ReflectorIF.hpp Rotor.hpp RotorIF.hpp
OBJS = Control.o

.PHONY: upload sense clean

all: $(BINS)

upload:
	touch check
	scp -P $(PORT) check $(FILES) $(USERNAME)@$(SERVER):assignment$(ASSIGNMENT)

sense:
	scp -P $(PORT) $(USERNAME)@$(SERVER):log.txt $(USERNAME)@$(SERVER):compile.log .
	tail compile.log log.txt

clean:
	rm -f $(BINS) $(OBJS) $(DEPSFILE) check log.txt compile.log

$(BINS): %: %.cpp $(HDRS) $(OBJS) $(DEPSFILE)
	$(CXX) $(CFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $< $(OBJS)

$(DEPSFILE): $(SRCS)
	$(CXX) -MM $(SRCS) > $(DEPSFILE)

-include $(DEPSFILE)

